package com.samsung.eci.wiki.control;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.samsung.eci.wiki.bean.Nodes;
import com.samsung.eci.wiki.service.CommonService;

@Controller
@RequestMapping("/common")
public class CommonController {
	@Autowired
	private CommonService commonService;

	
	@RequestMapping("/getTree")
	@ResponseBody
	public String getTree(String wikiId){
		List<Nodes> nodes = commonService.getTree(wikiId);
		return JSON.toJSONString(nodes);
	}

}
